<h3 class="yellow-bg-title" id="reset-password-title">Reset Password</h3>
<?php if ($command == "done"): ?>
    <div id="success-notice-2">
        We've successfully reset your password and sent you an email with the instructions you will need to follow in order to set a new password.
    </div>
    <div class="loading"><img src="/images/loading.gif" alt="Loading..."></div>
<?php else: ?>
    <form id="reset-password-form-modal" action="<?php echo url_for('/profile-reset-password-modal') ?>" method="post">
        <?php echo $form->renderHiddenFields(false) ?>
        <div class="row">
            <ul class="text">
                <li class="first">
                    <?php echo $form['email']->renderLabel() ?>
                    <?php echo $form['email'] ?>
                    <?php if ($form["email"]->hasError()): ?>
                        <?php include_partial("common/error", array("form" => $form, "field" => "email", "name_format" => "reset_password")) ?>
                    <?php endif; ?>
                </li>
            </ul>
        </div>
        <div class="clear"></div>
        <div class="sign-in-row">
            <ul class="submit">
                <li>
                    <button class="blue-button-30" type="submit" id="submit-reset-password-modal">Reset</button>
                </li>
                <li>
                    <div><a id="sign-in-link-modal" href="javascript:;">< sign in</a></div>
                </li>
            </ul>
        </div>
    </form>
    <script type="text/javascript">
        //<![CDATA[
        $(document).ready(function(){
            // hide element's error on focus
            $formElement = $('form .prompt-text');
            $formElement.live("focus", function() {
                $this = $(this);
                $("#" + $this.attr("id") + "_error").addClass("error-invisible").removeClass("error-visible");
            });

            // don't show the labels for non-empty input elements
            $('form .prompt-text').each(function(){
                $this = $(this);
                $thisLabel = $this.parent().find(":eq(0)");

                if($.trim($this.val())) {
                    $thisLabel.addClass("label-invisible");
                    $this.addClass('user-text');
                }
            });

            $('#sign-in-link-modal').click(function() {
                $('#reset-password-block-modal').hide();
                $('#sign-in-block-modal').show();
                return false;
            });

            // make an attempt to submit this form
            $('#submit-reset-password-modal').click(function() {     
                $("#reset-password-form-modal").hide();
                $("#reset-password-block-modal").append(loadingHtml);
                $('#reset-password-form-modal').ajaxSubmit(function(data){
                    $('#reset-password-block-modal').html(data);
                });
                return false;
            });
        });
        //]]>
    </script>
<?php endif; ?>